package net.huashitong.synthetical.newSupervision.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.synthetical.newSupervision.dao.TaskScoreDao;
import net.huashitong.synthetical.newSupervision.entity.TaskScore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 * User: ling
 * Date: 2019/8/5
 * Time: 15:40
 * To change this template use File | Settings | File Templates.
 * Description:
 */
@Service
public class TaskScoreService extends StringPKService<TaskScore> {
    @Autowired
    private TaskScoreDao taskScoreDao;
    @Autowired
    private SysTableService tableService;
    @Override
    protected BaseDao<TaskScore, String> getDao() {
        return this.taskScoreDao;
    }

    @Override
    protected void beforeSave(TaskScore obj) {
        obj.setSysId(tableService.updateMaxSysId("t_task_score", null));
    }

}
